/*
 * MessagingPanel.h
 *
 *  Created on: Jan 26, 2012
 *      Author: erudhes
 */

#ifndef MESSAGINGPANEL_H_
#define MESSAGINGPANEL_H_
#include <wx/wx.h>
#include "WxUtils.h"

class wxRichTextCtrl;

/**
 * This class is the panel for the messaging part of the application - holding the controllers
 *
 * @see IGameController
 * @author Rudolf Heszele heszele@gmail.com
 * @version 1.0
 * @since 2012-03-08
 */
class MessagingPanel: public wxPanel
{
	public:
		static const int HEIGHT = 600;
		static const int WIDTH = 400;
		/**
		 * The only constructor takes the parent wxFrame as the parameter
		 *
		 * @param parent The wxFrame object holding this Panel
		 */
		MessagingPanel(wxFrame* parent);
		// Overwrite some inherited methods
		// TODO: This is not needed. Nor here nor in MainPanel
		void SetClientSize(int width, int height);
		void SetClientSize(const wxSize& size);
		void SetClientSize(const wxRect& rect);
		/**
		 * Event handler for message sending functionality
		 *
		 * Triggers when the user clicks on the Send button or presses the Enter
		 * @param event The object holding informations about the event. Created by wxWidgets
		 */
		void onMessageSending(wxCommandEvent& event);
		/**
		 * Helper method to add a message to the controllers to show it to the user
		 *
		 * @param message The message to be shown
		 * @param color The color of the message
		 */
		void addMessage(const wxString& message, WxUtils::Color color);

	private:
		wxRichTextCtrl* mMessagingTextCtrl;
		wxTextCtrl* mMessageSendingTextCtrl;
		wxButton* mMessageSendingButton;

		DECLARE_EVENT_TABLE()
};

#endif /* MESSAGINGPANEL_H_ */
